package model;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class Invoice {
	
	private String customerName;
	private int invoiceID;
	private String date;
	private String customerID;
	private double total;
	private Set<InvoiceDetail> invoiceDetail;

	
	@Id
	@GeneratedValue
	public int getInvoiceID() {
		return invoiceID;
	}

	public void setInvoiceID(int invoiceID) {
		this.invoiceID = invoiceID;
	}

	@OneToMany(targetEntity = InvoiceDetail.class, mappedBy = "invoice",
				cascade = CascadeType.ALL, fetch = FetchType.EAGER)
//	@JoinColumn(name="invoice_Id")
	public Set<InvoiceDetail> getInvoiceDetail() {
		return invoiceDetail;
	}

	public void setInvoiceDetail(HashSet<InvoiceDetail> invoiceDetail) {
		this.invoiceDetail = invoiceDetail;
	}


	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public void setInvoiceDetail(Set<InvoiceDetail> invoiceDetail) {
		this.invoiceDetail = invoiceDetail;
	}

	public String getCustomerID() {
		return customerID;
	}

	public void setCustomerID(String customerID) {
		this.customerID = customerID;
	}

	public double getTotal() {
		return total;
	}

	public void setTotal(double total) {
		this.total = total;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	
}
